Python Trouble with matrix pathfinding (DFS)

welcome to shbcf.ru